package answers;

public class TrueFalseAnswer implements IAnswer
{

	public TrueFalseAnswer(boolean value)
	{
		this.value = value;
	}
	@Override
	public boolean compare(IAnswer other)
	{
		if((other instanceof TrueFalseAnswer) == false)
		{
			return false;
		}
		else if(((TrueFalseAnswer)other).getResult() == this.getResult())
		{
			return true;
		}
		else
		{
			return false;
		}
	}

	public void setResult(boolean result)
	{
		this.value = result;
	}
	public boolean getResult()
	{
		return value;
	}

	private boolean value;

	@Override
	public String getText()
	{
		if(value == true)
		{
			return new String("true");
		}
		else
		{
			return new String("false");
		}
	}
}
